<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //冒泡排序
    let arr=[1,3,2,6,5,4];
    let temp;
    //两层循环
    for(let i=1;i<arr.length;i++){
        for(let j=0;j<arr.length-i;j++){
            if(arr[j]>arr[j+1]){
                temp = arr[j];
                arr[j]=arr[j+1];
                arr[j+1]=temp;
            }
        }
    }
    console.log(arr);
    
    //二维数组
    let arr2=[[1,2,3],[4,5,6],[7,8,9]];
    console.log(arr2[0][0]);//1
    console.log(arr2[0][1]);//2
    console.log(arr2[0][2]);//3
    //循环遍历二维数组
    let arr3=[[12,34,45],[23,34,2],[67,56,54]];
    console.log(arr3[2][1]);


</script>
</html>